<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="author" content="tis-tis" />
<link href="{$tpl_path}/adminstyle.css" type=text/css rel=stylesheet />
{popup_init src="../js/common.js"} 
{popup_init src="../libs/ckeditor/ckeditor.js"}
<title>{$title}</title>
</head>

<body>
<!-- 头部 -->
<div class="adminbox">{include file="header.tpl"} <!-- 左边工具条-->
<div class="mainbox">{include file="sidebar.tpl"} <!-- 右边内容部分，即可变部分 -->
<div class="contentbox">
<form name="form1" method="post" action="article.php"
	onsubmit="return validate()">
<div>文章名称：<input maxlength="100" type="text" name="title" size="30"
	value="{$article.title|escape}"><font style="color: red">*不能为空</font></div>
<div class="height_5"></div>
<div>分类选择：<select name="article_cat">
	<option value="0">请选择分类</option>
	{$cat_select}
</select><font style="color: red">*必须选择分类</font></div>
<div align="center">
<hr></hr>
<h1>文章内容</h1>
</div>
<div align="center"><textarea name="content">{$article.content} </textarea></div>
<div align="center"><input type="submit" value="提交" /> <input
	type="reset" value="重置" /> <input type="hidden" name="act"
	value="{$form_action}" /> <input type="hidden" name="id"
	value="{$article.article_id}" /> <input type="hidden" name="old_article_name"
	value="{$article.title}" /></div>
</form>
</div>
</div>
</div>
{literal}
<script language="JavaScript">
/**
 * 引入CKEDIROT.
 */
CKEDITOR.replace( 'content' ); 　　

function validate() {
	var form = document.forms['form1'];
	var result='';

	var value = form.elements['title'].value;
	if (value==null || trim(value)=='') {
		result += "文章不能为空！\n";
    }

	value = form.elements['article_cat'].value;
    if (value ==0) {
    	result += "必须选择一个分类";
    }

    if (result != '') {
       alert(result);
       return false;
    }

    return true;
}
</script>
{/literal}
</body>
</html>
